package com.gw.vip.center.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gw.vip.center.dao.UserLoginMapper;
import com.gw.vip.center.po.UserLogin;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author GW
 * @description
 * @since 2022-03-30
 */
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserLoginService extends ServiceImpl<UserLoginMapper, UserLogin> {
    private final UserLoginMapper mapper;

    public UserLogin getByBase(String channelId, String unionId) {
        QueryWrapper<UserLogin> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(UserLogin::getChannelId, channelId);
        queryWrapper.lambda().eq(UserLogin::getUnionId, unionId);
        return getOne(queryWrapper);
    }

}
